package corp.edu.amadeus.web.action;

import corp.edu.amadeus.web.action.navigation.NavegableActionBase;
import corp.edu.amadeus.core.business.object.impl.ContentBO;
import corp.edu.amadeus.core.business.service.ifc.IContentService;
import corp.edu.amadeus.core.business.locator.ServiceLocator;
import java.util.Collection;

import org.apache.log4j.Logger;

public class CompositeAction extends NavegableActionBase {

	private static Logger log = Logger.getLogger(CompositeAction.class);
	private IContentService contentService;
	private Integer id;
	private ContentBO compositeContent;

	public CompositeAction() {
		super();
		this.contentService = ServiceLocator.getContentService();
	}

	public String execute() throws Exception {
    	return SUCCESS;
    }

	public String compositeImagen() throws Exception {
		log.debug("## Composite id: " + this.id);
		this.compositeContent = this.contentService.getContent(this.id);
		return this.execute();
	}

	public String compositeWrapper() throws Exception {
		log.debug("## Composite id: " + this.id);
		this.compositeContent = this.contentService.getContent(this.id);
		return this.execute();
	}

	@Override
	public void loadMenu() {
		this.menu.put("Crear contenido: ", "createContent");
		this.menu.put("Componer contenido", "compositeContent");
	}

	public Integer getId() { return this.id; }
	public void setId(Integer i) { this.id = i; }

	public ContentBO getCompositeContent() { return this.compositeContent; }
	public void setCompositeContent(ContentBO c) { this.compositeContent = c; }

}